home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16628 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  823 b 

  1. Path: news.tricon.net!usenet
  2. From: Thomas A Cooper <tacooper@tricon.net>
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Q:Hex to Decimal?
  5. Date: Thu, 11 Apr 1996 11:17:29 -0400
  6. Organization: Tri-Cities Connection
  7. Message-ID: <316D2289.4759@tricon.net>
  8. NNTP-Posting-Host: pm1-13.tricon.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. I saw in a magazine a simple function to convert a HEX string to an 
  15. integer:
  16.  
  17. long int FAR PASCAL hex2int(char far *s)
  18. {
  19.      return strtol(s,NULL,16);
  20. }
  21.  
  22.  I'm struggling with the reverse situation, a function to convert an 
  23. integer into a HEX string. Anybody got any ideas?? Thanks in advance for 
  24. your help.
  25.                               Tom Cooper
  26.                               tacooper@tricon.net
  27.